package com.github.chirspan.xaas.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.github.chirspan.xaas.security.component.OAuth2ExceptionSerializer;
import org.springframework.http.HttpStatus;

/**
 * *******description*******
 * <p>
 * *************************
 *
 * @author chenpan
 * @date 2020/5/26 12:23
 */
@JsonSerialize(using = OAuth2ExceptionSerializer.class)
public class TokenException extends Auth2Exception {

    public TokenException(String msg, Throwable t) {
        super(msg);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "401";
    }

    @Override
    public int getHttpErrorCode() {
        return HttpStatus.UNAUTHORIZED.value();
    }
}
